package com.axxc.jpa.pattendegign.builder;

import java.util.ArrayList;
import java.util.List;

import com.axxc.jpa.pattendegign.commons.C;

/**
 * 
 * @ClassName Computer
 * @Description //TODO 模拟构造者模式,属于创建型
 * @author xxc
 * @data 2018年9月1日下午8:48:02
 * @see {@link http://gitee.com/biuabiu/ }
 */
public class Computer<T extends C> implements C {

	private static final long serialVersionUID = 1L;
	private List<T> items = new ArrayList<>();

	@Override
	public void show() {
		items.forEach(e -> e.show());
	}

	public Computer<T> builder(T t) {
		this.items.add(t);
		return this;
	}

}
